package probability;

import basics.DenseMatrix;
import basics.DenseVector;

public class ProbabilitiesTest {

	public static void testMultivariateGaussian() {
		DenseVector mean = new DenseVector(new double[] { 1, 2 });
		DenseMatrix var = new DenseMatrix(new double[][] { { 4, 2 }, { 2, 4 } });
		DenseVector x = new DenseVector(new double[] { 1, 2 });

		MultivariateGaussianDistribution mg = new MultivariateGaussianDistribution(mean, var);

		mean = new DenseVector(new double[] { 1, 2 });
		var = new DenseMatrix(new double[][] { { 4, 2 }, { 2, 4 } });
		x = new DenseVector(new double[] { 1, 2 });

		MultivariateGaussianDistribution mg2 = new MultivariateGaussianDistribution(mean, var);

		mg = MultivariateGaussianDistribution.product(mg, mg2);
		
		System.out.println(mg.measure(x));
	}

	public static void testConfGeomFunct() {
		System.out.println(ConfluentGemFunction.M(500, 1, -5));
	}

	public static void testGPSampling() {
		GaussianDistribution g1 = new GaussianDistribution(1, 2);
		GaussianDistribution g2 = new GaussianDistribution(0, 1);
		System.out.println("-----\n" + GaussianDistribution.sampleIndicatorProduct(10, g1, g2));
	}
}
